function createFlashEmbed(soundFile,imgobj,playerloc){
	var emout = "";
	
	if(imgobj.className == "stopped"){
		var p = document.getElementsByClassName('playing');
		
		for(var i=0; i<p.length; i++){
			if(playerloc == "profile"){
				p[i].src = base_url+'/images/playbtn.png';
				p[i].className = 'stopped';
			} else {
				p[i].src = base_url+'/images/play_btn.gif';
				p[i].className = 'stopped';
			}
		}
		
		imgobj.className = 'playing';
		
		if(playerloc == "profile"){
			imgobj.src = base_url+'/images/stopbtn.png';
		} else {
			imgobj.src = base_url+'/images/stop_btn.gif';
		}
		
		emout += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		emout += 'id="SoundPlayer" width="0" height="0"';
		emout += 'codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">';
		emout += '<param name="movie" value="'+base_url+'/SoundPlayer.swf" />';
		emout += '<param name="quality" value="high" />';
		emout += '<param name="bgcolor" value="#869ca7" />';
		emout += '<param name="allowScriptAccess" value="always" />';
		emout += '<param name="FlashVars" value="sndUrl='+soundFile+'"/>';
		emout += '<embed src="'+base_url+'/SoundPlayer.swf" quality="high" bgcolor="#869ca7"';
		emout += 'width="0" height="0" name="SoundPlayer" align="middle"';
		emout += 'play="true"';
		emout += 'loop="false"';
		emout += 'quality="high"';
		emout += 'flashvars="sndUrl='+soundFile+'"';
		emout += 'allowScriptAccess="always"';
		emout += 'type="application/x-shockwave-flash"';
		emout += 'pluginspage="http://www.adobe.com/go/getflashplayer">';
		emout += '</embed>';
		emout += '</object>';
		
		//alert(emout);
		
		document.getElementById('soundPlayer').innerHTML = emout;
	} else {
		imgobj.className = 'stopped';
		if(playerloc == "profile"){
			imgobj.src = base_url+'/images/playbtn.png';
		} else {
			imgobj.src = base_url+'/images/play_btn.gif';
		}		
		document.getElementById('soundPlayer').innerHTML = "";
	}
}

document.getElementsByClassName = function(cl) {
	var retnode = [];
	var myclass = new RegExp('\\b'+cl+'\\b');
	var elem = this.getElementsByTagName('*');
	for (var i = 0; i < elem.length; i++) {
	var classes = elem[i].className;
	if (myclass.test(classes)) retnode.push(elem[i]);
	}
	return retnode;
}; 

function playbackDone(){
	var p = document.getElementsByClassName('playing');
		
	for(var i=0; i<p.length; i++){
		if(globalView == "profile"){
			p[i].src = base_url+'/images/playbtn.png';
			p[i].className = 'stopped';
		} else {
			p[i].src = base_url+'/images/play_btn.gif';
			p[i].className = 'stopped';
		}
	}
}